package com.chixing.day04_oop;
/*
    JavaBean：（1）无参构造函数+（2）get，set方法
 */

public class Car {

    private int carId;
    private String carName;
    private String carColor;
    private String carBrand;

    public String getCarColor() {
        return carColor;
    }

    public void setCarColor(String carColor) {
        this.carColor = carColor;
    }

    public String getCarBrand() {
        return carBrand;
    }

    public void setCarBrand(String carBrand) {
        this.carBrand = carBrand;
    }

    //默认省略 无参构造函数
    public Car(){

    }

    //如果已经定义了 有参构造函数，
    // 则会把默认的无参构造函数覆盖，若还想使用，则需要显示的定义出来
    //有参构造函数
    public Car(int carId,String carName){
        this.carId=carId;
        this.carName=carName;
    }

    public Car(int carId,String carName,String carBrand,String carColor){
        this(carId,carName);
    }

    public int getCarId() {
        return carId;
    }

    public void setCarId(int carId) {
        this.carId = carId;
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }
}
